xen: arm: allow platform code to select dom0 event channel irq
authorIan Campbell <ian.campbell@citrix.com>
Wed, 20 Nov 2013 13:40:48 +0000 (13:40 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 29 Nov 2013 09:26:06 +0000 (09:26 +0000)
Currently the hardcoded use of GUEST_EVTCHN_PPI is problematic if that is a
real PPI on the platform.

We really need to be smarter about selecting an unused PPI but in the meantime
we can at least give the platform code the option of hardcoding a number which
works for the platform.

Hardcode a suitable PPI on the Xgene platform.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
xen/arch/arm/domain.c
xen/arch/arm/platform.c
xen/arch/arm/platforms/xgene-storm.c
xen/include/asm-arm/platform.h

index 2f57d019e2f23518049b8e73119d882b16d30a28..52d2403345579d33f68d3e85cf8dd378374b2190 100644 (file)
@@ -31,6 +31,7 @@
 #include <asm/processor-ca15.h>
 
 #include <asm/gic.h>
+#include <asm/platform.h>
 #include "vtimer.h"
 #include "vuart.h"
 
@@ -526,8 +527,10 @@ int arch_domain_create(struct domain *d, unsigned int domcr_flags)
     if ( (rc = vcpu_domain_init(d)) != 0 )
         goto fail;
 
-    /* XXX dom0 needs more intelligent selection of PPI */
-    d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
+    if ( d->domain_id )
+        d->arch.evtchn_irq = GUEST_EVTCHN_PPI;
+    else
+        d->arch.evtchn_irq = platform_dom0_evtchn_ppi();
 
     /*
      * Virtual UART is only used by linux early printk and decompress code.
index 0fbbdc7e2192933f694c3d442e7bd4742c4699e4..a7f9ee413d69c705b387e7a1be36679a1b038f52 100644 (file)
@@ -156,6 +156,13 @@ bool_t platform_device_is_blacklisted(const struct dt_device_node *node)
     return dt_match_node(blacklist, node);
 }
 
+unsigned int platform_dom0_evtchn_ppi(void)
+{
+    if ( platform && platform->dom0_evtchn_ppi )
+        return platform->dom0_evtchn_ppi;
+    return GUEST_EVTCHN_PPI;
+}
+
 /*
  * Local variables:
  * mode: C
index 23ec46deb6bf9a22d6357e263617b87ad8a053f9..f416da3dacb9175d900ecded2c99dc910d96a541 100644 (file)
@@ -36,6 +36,7 @@ static const char * const xgene_storm_dt_compat[] __initconst =
 PLATFORM_START(xgene_storm, "APM X-GENE STORM")
     .compatible = xgene_storm_dt_compat,
     .quirks = xgene_storm_quirks,
+    .dom0_evtchn_ppi = 24,
 PLATFORM_END
 
 /*
index c9314e5e9dc7882b4a6300296ce832843e089193..5900ee407c436f6b0dc88598fd828f61ff879e83 100644 (file)
@@ -37,6 +37,10 @@ struct platform_desc {
      * List of devices which must not pass-through to a guest
      */
     const struct dt_device_match *blacklist_dev;
+    /*
+     * The IRQ (PPI) to use to inject event channels to dom0.
+     */
+    unsigned int dom0_evtchn_ppi;
 };
 
 /*
@@ -61,6 +65,7 @@ void platform_reset(void);
 void platform_poweroff(void);
 bool_t platform_has_quirk(uint32_t quirk);
 bool_t platform_device_is_blacklisted(const struct dt_device_node *node);
+unsigned int platform_dom0_evtchn_ppi(void);
 
 #define PLATFORM_START(_name, _namestr)                         \
 static const struct platform_desc  __plat_desc_##_name __used   \